<%@page import="com.bean.Emp"%>
<%@page import="com.emp.database.EmpOperate,java.util.*"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<script type="text/javascript">
	function checkDel(empno){
		if(confirm("是否确定删除")){
			window.location.href="delEmp?empno="+empno+"";
		}
		//http://fdgfg/delEmp.jsp?empno=1010
	}
	
	
	
</script>
</head>
<body>
	<input type="button" value="添加员工信息" onclick="javaScript:window.location.href='emp/addEmp.jsp'"/>
	<table  border="1" width="100%" cellpadding="0" cellspacing="0">
		<tr>
			<td>员工编号</td>
			<td>员工姓名</td>
			<td>工作岗位</td>
			<td>入职日期</td>
			<td>操作</td>
		</tr>
		<c:forEach var="emp" items="${list }" varStatus="vs">
		<tr bgcolor="${vs.index%2==0?'#DE5246':'#C4A957' }">
			<td>${emp.empno }</td>
			<td>${emp.ename }</td>
			<td>${emp.job }</td>
			<td>${emp.hiredate }</td>
			<td><a href="upEmp?empno=${emp.empno }" >修改</a>/
				<a href="javaScript:void(0)" onclick="checkDel(${emp.empno })">删除</a></td>
		</tr>
		</c:forEach>
	</table>
	<div align="center" style="margin-top: 10px ">
		当前第${currentPage }/共${lastPage }页
		<c:if test="${currentPage!=1 }">
		<span><a href="ManagerEmp?currentPage=1" style="text-decoration: none">首页</a></span>
		<span><a href="ManagerEmp?currentPage=${currentPage-1 }" style="text-decoration: none">上一页</a></span>
		</c:if>
		<c:if test="${currentPage!=lastPage }">
			<span><a href="ManagerEmp?currentPage=${currentPage+1 }" style="text-decoration: none">下一页</a></span>
			<span><a href="ManagerEmp?currentPage=${lastPage }" style="text-decoration: none">尾页</a></span>
		</c:if>
	</div>
	
	
</body>
</html>